package xidw_router

import (
	"server/apps/xidw/xidw_api"
	"server/middleware"

	"github.com/gin-gonic/gin"
)

type ApiRouter struct{}

func (s *ApiRouter) InitApiRouter(Router *gin.RouterGroup) {
	apiRouter := Router.Group("api").Use(middleware.OperationRecord())
	apiRouterWithoutRecord := Router.Group("api")
	apiRouterApi := xidw_api.SystemApiApi{}
	{
		apiRouter.POST("createApi", apiRouterApi.CreateApi)
		apiRouter.POST("deleteApi", apiRouterApi.DeleteApi)
		apiRouter.POST("getApiById", apiRouterApi.GetApiById)
		apiRouter.POST("updateApi", apiRouterApi.UpdateApi)
		apiRouter.DELETE("deleteApisByIds", apiRouterApi.DeleteApisByIds)
	}
	{
		apiRouterWithoutRecord.POST("getAllApis", apiRouterApi.GetAllApis)
		apiRouterWithoutRecord.POST("getApiList", apiRouterApi.GetApiList)
	}
}
